package com.aitangba.pickdatetime.adapter.datetime;

import android.support.annotation.NonNull;

import com.aitangba.pickdatetime.bean.DateParams;
import com.aitangba.pickdatetime.bean.DatePick;


/**
 * Created by fhf11991 on 2017/8/29.
 */

public class MinuteAdapter extends DatePickAdapter {

    public MinuteAdapter(@NonNull DateParams dateParams, @NonNull DatePick datePick) {
        super(dateParams, datePick);
    }

    @Override
    public int getCurrentIndex() {
        int index = 0;
        if (mDatePick.minute < 10) {
            index = 0;
        } else if (mDatePick.minute < 20) {
            index = 1;
        } else if (mDatePick.minute < 30) {
            index = 2;
        } else if (mDatePick.minute < 40) {
            index = 3;
        } else if (mDatePick.minute < 50) {
            index = 4;
        } else if (mDatePick.minute < 60) {
            index = 5;
        }
        //  return mData.indexOf(index);
        return index;
    }

    @Override
    public void refreshValues() {
        setData(getArray(60));
    }
}
